<template>
  <div class="subPage" @touchstart="touchstart">
    <div class="centBox">
      <div class="userMsg">
        <!-- <div class="divTop">{{interrogationKey == '1' ?  '图文问诊' : interrogationKey == '2' ? '音频问诊' : interrogationKey == '3' ? '专科门诊' : '专家问诊'}}</div> -->
        <div class="topBox">
          <div class="topLeft">{{doctorInfo}}</div>
          <div class="topRight"></div>
        </div>
        <div class="divCenter">
          <span>{{doctorInfo.doctor_name}}</span>
          <span>{{doctorInfo.dept_name}}<span class="slash">&nbsp;/&nbsp;</span>{{doctorInfo.positional_title}}</span>
        </div>
        <div class="divBom">
          <!-- <span v-if="interrogationKey != '3' && interrogationKey != '4'">{{date}}<span class="slash">&nbsp;/&nbsp;</span>{{time}}</span> -->
          <!-- <span >{{doctorInfo.arrange_day_timestamp}}<span class="slash">&nbsp;/&nbsp;</span>{{doctorInfo.period_id == 1 ? '上午' : '下午'}}</span> -->
          <span>{{doctorInfo.arrange_day}}<span class="slash">&nbsp;/&nbsp;</span>{{doctorInfo.period}}&nbsp;&nbsp;{{doctorInfo.begin_time}} - {{doctorInfo.end_time}}</span>
          <!-- <span><span class="redClolr">¥</span>{{interrogationKey == '1' ?  doctorInfo.image_text_price : interrogationKey == '2' ? doctorInfo.video_price :  interrogationKey == '3' ? doctorInfo.used_tick+'.00' : doctorInfo.used_tick+ '.00'}}</span> -->
          <!-- <div v-if="interrogationKey == '3'"><span><span class="redClolr">¥</span>{{interrogationKey == '1' ?  doctorInfo.image_text_price : interrogationKey == '2' ? doctorInfo.video_price :  interrogationKey == '3' ? doctorInfo.used_tick : doctorInfo.used_tick}}</span></div> -->
        </div>
      </div>
      <div class="detailsBox">
        <!-- <div class="choiceBox" @click="showModal">
          选择就诊人
          <div class="iconBox">
            <span>点击选择</span>
            <img src="/static/images/rightIcon.png">
          </div>
        </div>
        <div class="msgBox">
          <div>
            <span class="labelClass">就诊人员：</span>
            <span>{{userDetails.regular_name ? userDetails.regular_name : ''}}</span>
            <span v-if="userDetails.is_main == 1" class="identityClass">本人</span>
          </div>
          <div>
            <span class="labelClass">身份证号：</span>
            <span>{{userDetails.regular_certid ? userDetails.regular_certid : ''}}</span>
          </div>
          <div>
            <span class="labelClass">手机号：</span>
            <span>{{userDetails.regular_phone ? userDetails.regular_phone : ''}}</span>
          </div>
        </div> -->
        <div class="describeBox">
          <div class="record">{{step.current_medical_history.length}}/100字</div>
          <div class="iptBox">
             <!-- <i-input placeholder="病情描述（必填）" type="textarea" v-model="step.current_medical_history" @change="describeChange" maxlength="100" class="ipt" /> -->
             <!-- <i-input :value="step.current_medical_history" type="textarea" title="详细地址" placeholder="请输入详细地址(最多50字)" maxlength="50" i-class="ipt" /> -->
            <!-- <textarea v-if="disab && !disab2" :disable-default-padding="true" placeholder-style='color:#999999;font-size: 28rpx;'  placeholder="请详细描述您的疾病症状，治疗用药情况；在下方上传近期的病历、处方、检验、检查等资料，方便医生更好的为您解答" @blur="bindblur" :auto-focus="true" v-model="step.current_medical_history" @change="describeChange" maxlength="100" :fixed="true" auto-height class="ipt" /> -->
            <textarea v-if="disab && !disab2" :disable-default-padding="true"   @blur="bindblur" :auto-focus="true" v-model="step.current_medical_history"  @change="describeChange" maxlength="200" class="ipt" style="height：50vh;" />
            <div v-if="!disab && !disab2" class="ipt3" @click="showDisab">请详细描述您的疾病症状，治疗用药情况；病情描述需要在10字以上；在下方上传近期的病历、处方、检验、检查等资料，方便医生更好的为您解答</div>
            <div v-if="disab2" class="ipt" @click="showDisab">{{step.current_medical_history}}</div>
          </div>
          <div class="uploadBox">
           <div class="upload selectBox" @click="chooseImage">
              <img src="/static/images/addImage.png">
            </div>
            <div v-if='files.length==0'> 
              上传相关图片（近期的病例、处方、检验、检查等）
            </div>
            <div class="uploadRight">
              <div class="upload uploadImgBox" v-for="(item, index) in files" :key="index">
                <img :src="item" @click="previewImage($event,index)" >
                <!-- <img src="/static/images/close.png" class="closeClass"  > -->
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="caseBox">
        <div class="caseTit">既往病史（必填）</div>
        <div class="caseData">
          <div class="diseaseTit">
            疾病史
          </div>
          <ul class="diseaseBox">
            <li v-for="(item, index) in arraySum.list1" :class="item.class" :key="index" @click="activeClick(index, 'list1')">{{item.name}}</li>
          </ul>
        </div>
        <div class="caseData">
          <div class="diseaseTit">
            传染病史
          </div>
          <ul class="diseaseBox">
            <li v-for="(item, index) in arraySum.list2" :class="item.class" :key="index" @click="activeClick(index, 'list2')">{{item.name}}</li>
          </ul>
        </div>
        <div class="caseData">
          <div class="diseaseTit">
            手术史
          </div>
          <ul class="diseaseBox">
            <li v-for="(item, index) in arraySum.list3" :class="item.class" :key="index" @click="activeClick(index, 'list3')">{{item.name}}</li>
          </ul>
        </div>
        <div class="otherBox">
          <span>其他补充</span>
          <span>
            <input type="text" placeholder="请输入其他补充" v-model="step.anamnesis.qt" class="ipt2" />
          </span>
        </div>
      </div>
      <div class="caseBox">
        <div class="caseTit">过敏史（必填）</div>
        <div class="caseData">
          <div class="diseaseTit">
            药物过敏
          </div>
          <ul class="diseaseBox">
            <li v-for="(item, index) in arraySum.list4" :class="item.class" :key="index" @click="activeClick(index, 'list4')">{{item.name}}</li>
          </ul>
        </div>
        <div class="caseData">
          <div class="diseaseTit">
            食物及其他过敏
          </div>
          <ul class="diseaseBox">
            <li v-for="(item, index) in arraySum.list5" :class="item.class" :key="index" @click="activeClick(index, 'list5')">{{item.name}}</li>
          </ul>
        </div>
        <div class="otherBox">
          <span>其他补充</span>
          <span>
            <input type="text" placeholder="请输入其他补充" class="ipt2" v-model="step.allergy_history.qt" />
          </span>
        </div>
      </div>
      <div class="caseBox">
        <div class="caseTit">婚育史</div>
        <div class="caseData">
          <div class="diseaseTit">
            婚姻状况
          </div>
          <ul class="diseaseBox">
            <li v-for="(item, index) in arraySum.list6" :class="item.class" :key="index" @click="activeClick(index, 'list6')">{{item.name}}</li>
          </ul>
        </div>
        <div class="caseData">
          <div class="diseaseTit">
            生育妊娠状态（女性填写）
          </div>
          <ul class="diseaseBox">
            <li v-for="(item, index) in arraySum.list7" :class="item.class" :key="index" @click="activeClick(index, 'list7')">{{item.name}}</li>
          </ul>
        </div>
        <div class="otherBox">
          <span>其他补充</span>
          <span>
            <input type="text" placeholder="请输入其他补充" class="ipt2" v-model="step.obsterical_history.qt" />
          </span>
        </div>
      </div>
      <div class="caseBox">
        <div class="caseTit">家族史（必填）</div>
        <div class="caseData">
          <div class="diseaseTit">
            <!-- 婚姻状况 -->
          </div>
          <ul class="diseaseBox">
            <li v-for="(item, index) in arraySum.list8" :class="item.class" :key="index" @click="activeClick(index, 'list8')">{{item.name}}</li>
          </ul>
        </div>
        <!-- <div class="caseData">
          <div class="diseaseTit">
            生育状态（女性填写）
          </div>
          <ul class="diseaseBox">
            <li v-for="(item, index) in list7" :key="index">{{item.name}}</li>
          </ul>
        </div> -->
        <div class="otherBox">
          <span>其他补充</span>
          <span>
            <input type="text" placeholder="请输入其他补充" class="ipt2" v-model="step.family_history.qt" />
          </span>
        </div>
      </div>
      <div class="caseBox">
        <div class="caseTit">个人习惯</div>
        <div class="caseData">
          <div class="diseaseTit">
            <!-- 婚姻状况 -->
          </div>
          <ul class="diseaseBox">
            <li v-for="(item, index) in arraySum.list9" :class="item.class" :key="index" @click="activeClick(index, 'list9')">{{item.name}}</li>
          </ul>
        </div>
        <!-- <div class="caseData">
          <div class="diseaseTit">
            生育状态（女性填写）
          </div>
          <ul class="diseaseBox">
            <li v-for="(item, index) in list7" :key="index">{{item.name}}</li>
          </ul>
        </div> -->
        <div class="otherBox">
          <span>其他补充</span>
          <span>
            <input type="text" placeholder="请输入其他补充" class="ipt2" v-model="step.personal_habits.qt" />
          </span>
        </div>
      </div>
      <div class="btnBox" @click="toSuccess">
        确认预约
      </div>
    </div>
    <div class="modalClass" :style="{display: modalStyle}" >
        <div class="modalBox">
          <!-- <div class="modalTit">
            <img src="/static/images/videoTit.png">
          </div> -->
          <div class="closeBox" @click="close">
            <img src="/static/images/add_imgage.png">
          </div>
          <div class="modalCenter">
            <!-- <picker  name="picker_hx" class="picClass"  v-model="pic_array[pic_index].id" :data-selecthx="pic_array[pic_index].name" :range-key="pic_array[pic_index].name" :range="pic_array" @bindchange="bindPickerChange">
              <div class="picker">
                {{pic_array[pic_index].name}}
              </div>
            </picker> -->
            <picker name="regular_name" class="picClass" :value="hx_index"  :range="userList" range-key="regular_name"  @change="bindPickerChange"  >
              <div class="picker">
                {{userList.length!=0 ? userList[hx_index].regular_name : ''}}
              </div>
            </picker>
          </div>
          <div class="modalFooter">
            <div class="btnLeft" @click="close">取消</div>
            <div class="btnRight" @click="ok">确认</div>
          </div>
        </div>
      </div>
      <div class="modalShowClass" v-if="modalShow">
        <div class="modalBox">
            <div class="closeBox" @click="closeModal">
              <img src="/static/images/close.png">
            </div>
            <div class="modalTit">
              选择支付方式
            </div>
            <div class="modalCenter">
              <div class="paymentBox">
                <div class="paymentLeft"></div>
                <div class="paymentCenter"><span class="left">现金支付</span><span class="right">(支持微信支付)</span></div>
                <div class="paymentRight"></div>
              </div>
              <div class="paymentBox">
                <div class="paymentLeft"></div>
                <div class="paymentCenter"><span class="left">医保支付</span><span class="right">(支持武汉医保)</span></div>
                <div class="paymentRight"></div>
              </div>
            </div>
            <div class="modalFooter" @click="tooPaymentPage">提交</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  let app = getApp()
  let store = app.store
  import api from '@/api/api'
//   import { mapState } from 'vuex'
//   import nim from '@/utils/nim'
  import storage from '@/utils/storage'
//   import Bus from '@/utils/bus.js'
//   const { $Toast, $Message } = require('../../../../../static/iview/base/index')
//   import visitingTips from '@/components/visitingTips.vue'
  export default {
    components: {
    //   visitingTips
    },
    data () {
      return {
        disab: false,
        disab2:false,
        upLoadLodin: false,
        modalShow: false,
        ipt:'ipt',
        modalStyle: 'none',
        doctorInfo: {},
        host: '',
        date: '',
        time: '',
        interrogationKey: '',
        uploadImgList:[],
        // describe: '',
        pic_array: [
          { id: 13, name: '1室1厅1卫' },
          { id: 14, name: '1室2厅1卫' },
          { id: 15, name: '2室1厅1卫' },
          { id: 16, name: '3室1厅2卫' },
          { id: 17, name: '4室1厅2卫' },
          { id: 18, name: '5室1厅3卫' },
          { id: 19, name: '6室1厅3卫' },
          { id: 20, name: '7室以上' },
        ],
        userId: '',
        hx_index: 0,
        files: [],
        upImg: [],
        diseaseList: [
          {name: '无'},
          {name: '无'},
          {name: '无'},
          {name: '无'},
          {name: '无'},
          {name: '无'},
        ],
        userList: [],
        userDetails: {
          regular_name: '',
          regular_certid: '',
          regular_phone: ''
        },
        arraySum: {
          // 疾病史
          list1:[
            {name:'无', key:'0', class:''},
            {name:'哮喘', key:'1', class:''},
            {name:'高血脂症', key:'2', class:''},
            {name:'高血压', key:'3', class:''},
            {name:'高尿酸血症', key:'4', class:''},
            {name:'癫痫', key:'5', class:''},
            {name:'心脏病', key:'6', class:''},
            {name:'糖尿病', key:'7', class:''},
            {name:'脑卒中', key:'8', class:''},
            {name:'胃炎', key:'9', class:''},
            {name:'肝炎', key:'10', class:''}
          ],
          // 传染病史
          list2:[
            {name:'无', key:'0', class:''},
            {name:'肺结核', key:'1', class:''},
            {name:'病毒性肝炎', key:'2', class:''},
            {name:'血吸虫病', key:'3', class:''},
            {name:'淋病', key:'4', class:''}
          ],
          // 手术史
          list3:[
            {name:'无', key:'0', class:''},
            {name:'颅部手术', key:'1', class:''},
            {name:'颈部手术', key:'2', class:''},
            {name:'胸部手术', key:'3', class:''},
            {name:'腹部手术', key:'4', class:''},
            {name:'四肢手术', key:'5', class:''},
            {name:'骨折', key:'6', class:''},
            {name:'烧伤', key:'7', class:''},
            {name:'烫伤', key:'8', class:''},
            {name:'头部外伤', key:'9', class:''},
            {name:'肌腱外伤', key:'10', class:''}
          ],
          // 药物过敏
          list4:[
            {name:'无', key:'0', class:''},
            {name:'青霉素', key:'1', class:''},
            {name:'头孢类抗生素', key:'2', class:''},
            {name:'破伤风抗生素', key:'3', class:''},
            {name:'普鲁卡因', key:'4', class:''},
            {name:'地卡因', key:'5', class:''},
            {name:'磺胺类药物', key:'6', class:''},
            {name:'维生素B1', key:'7', class:''},
            {name:'泛影葡胺', key:'8', class:''},
            {name:'阿司匹林', key:'9', class:''}
          ],
          // 食物过敏
          list5:[
            {name:'无', key:'0', class:''},
            {name:'芒果', key:'1', class:''},
            {name:'牛奶', key:'2', class:''},
            {name:'海鲜', key:'3', class:''},
            {name:'笋', key:'4', class:''},
            {name:'香菇', key:'5', class:''},
            {name:'黄瓜', key:'6', class:''},
            {name:'油漆', key:'7', class:''},
            {name:'花粉', key:'8', class:''},
            {name:'皮毛', key:'9', class:''}
          ],
          // 婚姻史
          list6:[
            {name:'已婚', key:'1', class:''},
            {name:'未婚', key:'2', class:''}
          ],
          // 生育状态
          list7:[
            { name: "未生育", key: "1", class: "" },
            { name: "已生育", key: "2", class: "" },
            { name: "未怀孕", key: "3", class: "" },
            { name: "已怀孕", key: "4", class: "" },
          ],
          // 家族史
          list8:[
            {name:'无', key:'0', class:''},
            {name:'高血压', key:'1', class:''},
            {name:'糖尿病', key:'2', class:''},
            {name:'心脏病', key:'3', class:''},
            {name:'脑梗', key:'4', class:''},
            {name:'脑出血', key:'5', class:''},
            {name:'癌症', key:'6', class:''},
            {name:'过敏性疾病', key:'7', class:''},
            {name:'哮喘', key:'8', class:''},
            {name:'癫痫病', key:'9', class:''},
            {name:'白癜风', key:'10', class:''}
          ],
          // 个人习惯
          list9:[
            {name:'无', key:'0', class:''},
            {name:'吸烟', key:'1', class:''},
            {name:'饮酒', key:'2', class:''},
            {name:'熬夜', key:'3', class:''},
            {name:'低头', key:'4', class:''},
            {name:'久坐', key:'5', class:''},
            {name:'久站', key:'6', class:''},
            {name:'跷二郎腿', key:'7', class:''},
            {name:'强忍大小便', key:'8', class:''},
            {name:'饭后卧床', key:'9', class:''},
            {name:'如厕看书报', key:'10', class:''},
            {name:'不喜喝水', key:'11', class:''}
          ]
        },
        step: {
           allergy_history: {
              qt: "",
              swgm: "",
              ywgm: ""
            },
            anamnesis: {
              crb: "",
              jb: "",
              qt: "",
              sss: ""
            },
            apt_diagnosis_time: "",
            current_medical_history: "",
            doctor_id: "",
            family_history: {
              jzs_jsz: "",
              qt: ""
            },
            obsterical_history: {
              hyzk: "",
              syzt: ""
            },
            personal_habits: {
              grxg_grxg: "",
              qt: ""
            },
            regular_id: "",
            type: "3",
            upload_image: []
          }
        }
    },
    computed: {
      // className () {
      //   return active({
      //     // backgroundColor: this.tag ? 'brown' : 'dodgerblue'
      //     border:'1rpx solid #4A71E8',
      //     backgroundColor:'rgba(235,245,255,1)',
      //     color:'#4A71E8'
      //   })
      // }
    //   ...mapState([
    //     'messageList', 'unreadList', 'totleChat', 'allChat', 'doctorInfo', 'sessionsList'
    //   ])
    },
    onLoad (options) {
      let that = this
      that.upLoadLodin = false
      that.modalShow = false
      that.files = []
        that.upImg = []
        that.modalStyle = 'none'
        // that.userId = null
      that.userDetails = {
          regular_name: '',
          regular_certid: '',
          regular_phone: ''
        }
     that.arraySum = {
          // 疾病史
          list1:[
            {name:'无', key:'0', class:''},
            {name:'哮喘', key:'1', class:''},
            {name:'高血脂症', key:'2', class:''},
            {name:'高血压', key:'3', class:''},
            {name:'高尿酸血症', key:'4', class:''},
            {name:'癫痫', key:'5', class:''},
            {name:'心脏病', key:'6', class:''},
            {name:'糖尿病', key:'7', class:''},
            {name:'脑卒中', key:'8', class:''},
            {name:'胃炎', key:'9', class:''},
            {name:'肝炎', key:'10', class:''}
          ],
          // 传染病史
          list2:[
            {name:'无', key:'0', class:''},
            {name:'肺结核', key:'1', class:''},
            {name:'病毒性肝炎', key:'2', class:''},
            {name:'血吸虫病', key:'3', class:''},
            {name:'淋病', key:'4', class:''}
          ],
          // 手术史
          list3:[
            {name:'无', key:'0', class:''},
            {name:'颅部手术', key:'1', class:''},
            {name:'颈部手术', key:'2', class:''},
            {name:'胸部手术', key:'3', class:''},
            {name:'腹部手术', key:'4', class:''},
            {name:'四肢手术', key:'5', class:''},
            {name:'骨折', key:'6', class:''},
            {name:'烧伤', key:'7', class:''},
            {name:'烫伤', key:'8', class:''},
            {name:'头部外伤', key:'9', class:''},
            {name:'肌腱外伤', key:'10', class:''}
          ],
          // 药物过敏
          list4:[
            {name:'无', key:'0', class:''},
            {name:'青霉素', key:'1', class:''},
            {name:'头孢类抗生素', key:'2', class:''},
            {name:'破伤风抗生素', key:'3', class:''},
            {name:'普鲁卡因', key:'4', class:''},
            {name:'地卡因', key:'5', class:''},
            {name:'磺胺类药物', key:'6', class:''},
            {name:'维生素B1', key:'7', class:''},
            {name:'泛影葡胺', key:'8', class:''},
            {name:'阿司匹林', key:'9', class:''}
          ],
          // 食物过敏
          list5:[
            {name:'无', key:'0', class:''},
            {name:'芒果', key:'1', class:''},
            {name:'牛奶', key:'2', class:''},
            {name:'海鲜', key:'3', class:''},
            {name:'笋', key:'4', class:''},
            {name:'香菇', key:'5', class:''},
            {name:'黄瓜', key:'6', class:''},
            {name:'油漆', key:'7', class:''},
            {name:'花粉', key:'8', class:''},
            {name:'皮毛', key:'9', class:''}
          ],
          // 婚姻史
          list6:[
            {name:'已婚', key:'1', class:''},
            {name:'未婚', key:'2', class:''}
          ],
          // 生育状态
          list7:[
            { name: "未生育", key: "1", class: "" },
            { name: "已生育", key: "2", class: "" },
            { name: "未怀孕", key: "3", class: "" },
            { name: "已怀孕", key: "4", class: "" },
          ],
          // 家族史
          list8:[
            {name:'无', key:'0', class:''},
            {name:'高血压', key:'1', class:''},
            {name:'糖尿病', key:'2', class:''},
            {name:'心脏病', key:'3', class:''},
            {name:'脑梗', key:'4', class:''},
            {name:'脑出血', key:'5', class:''},
            {name:'癌症', key:'6', class:''},
            {name:'过敏性疾病', key:'7', class:''},
            {name:'哮喘', key:'8', class:''},
            {name:'癫痫病', key:'9', class:''},
            {name:'白癜风', key:'10', class:''}
          ],
          // 个人习惯
          list9:[
            {name:'无', key:'0', class:''},
            {name:'吸烟', key:'1', class:''},
            {name:'饮酒', key:'2', class:''},
            {name:'熬夜', key:'3', class:''},
            {name:'低头', key:'4', class:''},
            {name:'久坐', key:'5', class:''},
            {name:'久站', key:'6', class:''},
            {name:'跷二郎腿', key:'7', class:''},
            {name:'强忍大小便', key:'8', class:''},
            {name:'饭后卧床', key:'9', class:''},
            {name:'如厕看书报', key:'10', class:''},
            {name:'不喜喝水', key:'11', class:''}
          ]
        }
     that.step = {
          arrange_info_id: '',
           allergy_history: {
              qt: "",
              swgm: "",
              ywgm: ""
            },
            anamnesis: {
              crb: "",
              jb: "",
              qt: "",
              sss: ""
            },
            apt_diagnosis_time: "",
            current_medical_history: "",
            doctor_id: "",
            family_history: {
              jzs_jsz: "",
              qt: ""
            },
            obsterical_history: {
              hyzk: "",
              syzt: ""
            },
            personal_habits: {
              grxg_grxg: "",
              qt: ""
            },
            regular_id: "",
            type: "3",
            upload_image: []
          }
          
    },
    mounted () {
      
    },
    methods: {
      tooPaymentPage () {
        this.$router.replace(`/pages/subPage/register/paymentPage/main`)
      },
      closeModal () {
        this.modalShow = false
        // this.hx_index = 0
      },
      touchstart (e) {
        // console.log('开始滚动')
        if (this.step.current_medical_history.length == 0) {
          this.disab2 = false
          this.disab = false
        } else {
          this.disab2 = true
          this.disab = false
        }
      },
      showDisab () {
        this.disab = true
        this.disab2 = false
      },
      bindblur () {
        // console.log(123)
        if (this.step.current_medical_history.length == 0) {
          this.disab2 = false
          this.disab = false
        } else {
          this.disab2 = true
          this.disab = false
        }
      },
      activeClick (e, key) {
        if (this.arraySum[key][e].class == '') {
          this.$set(this.arraySum[key][e], 'class', 'active')
        } else {
          this.$set(this.arraySum[key][e], 'class', '')
        }
        if (key != 'list6' && key != 'list7') {
          if (e == 0) {
            this.arraySum[key].forEach((item, index) => {
              if (index != 0) {
                this.$set(this.arraySum[key][index], 'class', '')
              }
            })
          } else {
            this.arraySum[key].forEach((item, index) => {
              if (index == 0) {
                this.$set(this.arraySum[key][index], 'class', '')
              }
            })
          }
        } else {
          this.arraySum[key].forEach((item, index) => {
              if (index != e) {
                this.$set(this.arraySum[key][index], 'class', '')
              }
            })
        }
        let list = this.arraySum[key]
        // let list1 = ''
        // let list2 = ''
        // let list3 = ''
        // let list4 = ''
        // let list5 = ''
        // let list6 = ''
        // let list7 = ''
        // let list8 = ''
        // let list9 = ''
        this.arraySum[key] = []
        this.arraySum[key] = list
        // console.log(this.arraySum)
        
      },
      removeImg (e) {
        this.files.splice(e,1)
        this.upImg.splice(e,1)
      },
      describeChange () {
        // console.log('输入框字数', this.step.current_medical_history)
        // if (this.describe.length == 100) {
        //   wx.showModal({
        //     title: '提示',
        //     content: '字数不能超过100个',
        //     showCancel: false
        //   })
        // }
      },
      close () {
        this.modalStyle = 'none'
        this.hx_index = 0
      },
      ok () {
        this.modalStyle = 'none'
        this.userId = this.userList[this.hx_index].regular_id
        this.selectUser()
      },
      selectUser () {
        this.userList.forEach((item, index)=>{
          if (item.regular_id == this.userId) {
            this.userDetails = item
            return;
          }
        })
      },
      bindPickerChange (e) {
        // console.log(e)
        // console.log(1111)
        this.hx_index = e.mp.detail.value
        // this.userName = e.mp.detail.name
        // console.log('picker发送选择改变，携带值为', e.detail.value);
        // this.setData({   //给变量赋值
        // hx_index: e.detail.value,  //每次选择了下拉列表的内容同时修改下标然后修改显示的内容，显示的内容和选择的内容一致
        // })
        // console.log('自定义值:', this.data.hx_select);
      },
      selectImg () {
        let that = this
        wx.chooseImage({
          count: 9, // 默认9
          sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图，默认二者都有
          sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机，默认二者都有
          success: function (res) {
            // 返回选定照片的本地文件路径列表，tempFilePath可以作为img标签的src属性显示图片
            var tempFilePaths = res.tempFilePaths
            // console.log(tempFilePaths)
            that.uploadImgList = tempFilePaths
            that.upload(that, tempFilePaths)
          }
        })
      },
      chooseImage(e) {
        if (this.upLoadLodin) {
          this.$utils.showToast('text', '上传中，请稍后再试')
          return
        }
          let i = 0;                    // 多图上传时使用到的index
          let that = this;
          let max = '8';        //最大选择数
          let upLength;                        //图片数组长度
          let imgFilePaths;                //图片的本地临时文件路径列表
          wx.chooseImage({
            count: max || 1,           //一次最多可以选择的图片张数
            sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图，默认二者都有
            sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机，默认二者都有
            success: function (res) {
              let len = that.files.concat(res.tempFilePaths);
              
              // console.log(len)
              // console.log(maxLen)
              imgFilePaths = res.tempFilePaths;
              upLength = imgFilePaths.length;
              // console.log(imgFilePaths)
              // console.log(upLength)
              let maxLen = that.upImg.length*1 + upLength*1
              that.upLoadLodin = true
              if(len.length > max || maxLen > max){
                that.$utils.showToast('text', '最多只能上传8张！')
                that.upLoadLodin = false
                return false;
              }
              /**
               * 上传完成后把文件上传到服务器
               */
              wx.showLoading({
                title: '上传中...',
              })
              that.upLoad(imgFilePaths,i,upLength);            //上传操作
            },
            fail: function () {
              // console.log('fail');
            },
            complete: function () {
              // console.log('commplete');
            }
          })
        },
      upLoad(imgPath,i,upLength){
          let that = this;
          let hiseeToken = storage.getToken()
          // console.log(imgPath)
          //上传文件
          wx.uploadFile({
            url: api.host + "/api/emr/upload_image",
            filePath: imgPath[i],
            name: 'img0',
            header: {
              "content-type": "multipart/form-data",
              'hisee-token': hiseeToken,
              'Authorization': 'Bearer ' +  hiseeToken
            },
            success: function (res) {
              if (res.statusCode == 200) {
                 // 返回选定照片的本地文件路径列表，tempFilePath可以作为img标签的src属性显示图片
                //  console.log('上传成功' + i);
                // console.log('成功返回', res)
                 that.files = that.files.concat(imgPath[i]);        //合并图片显示数组
                      let imgData = JSON.parse(res.data);
                      that.upImg.push(imgData.data);
                      // console.log(that.upImg);
                // for (let index = 0; index < array.length; index++) {
                  // const element = array[index];
                  i++
                  if(i == upLength){
                    wx.hideLoading();    //上传结束，隐藏loading
                    wx.showModal({
                      title: '成功提示',
                      content: '上传成功',
                      showCancel: false,
                      success: function (res) {
                        that.upLoadLodin = false
                      }
                    })
                     
                  }else{
                    that.upLoad(imgPath,i,upLength);
                  }
                // }
                
              } else {
                // console.log(res);
                wx.hideLoading();
                wx.showModal({
                  title: '错误提示',
                  content: '上传图片失败',
                  showCancel: false,
                  success: function (res) {
                    that.files = []
                    that.upImg = []
                    that.upLoadLodin = false
                  }
                })
              }
             
            },
            fail: function (res) {
              // console.log(res);
              wx.hideLoading();
              wx.showModal({
                title: '错误提示',
                content: '上传图片失败',
                showCancel: false,
                success: function (res) {
                  that.files = []
                  that.upImg = []
                }
              })
            },
            complete: function(){
              
            }
          });
        },
      previewImage(e,index) {
        // console.log('图片路径', e)
        // console.log('下标', index)
          let that = this;
          wx.showActionSheet({
            itemList:["预览","删除"],
            success: function(res) {
              if(res.tapIndex === 0){
                // console.log('成功返回',res)
                  //选择预览
                mpvue.offAppHide()
                wx.previewImage({
                  current: that.files[index], // 当前显示图片的http链接
                  urls: that.files // 需要预览的图片http链接列表
                })
              } else {
                  //选择删除
                that.files.splice(index,1);                //删除本地图片地址数组中位置内容
                that.upImg.splice(index,1);            //删除提交给后台的图片数组中的位置内容
              }
            },
          })
        },
      getDateTime () {
        var now = new Date(); 
        var nowTime = now.toLocaleString(); 
        // var date = nowTime.substring(0,10);//截取日期 
        let date = now
        let y = date.getFullYear()
        let MM = date.getMonth() + 1
        MM = MM < 10 ? ('0' + MM) : MM
        let d = date.getDate();
        d = d < 10 ? ('0' + d) : d
        let h = date.getHours()
        h = h < 10 ? ('0' + h) : h
        let m = date.getMinutes()
        m = m < 10 ? ('0' + m) : m
        let s = date.getSeconds()
        s = s < 10 ? ('0' + s) : s
         date =  y + '-' + MM + '-' + d
        var time = nowTime.substring(11,20); //截取时间 
        var week = now.getDay(); //星期 
        var hour = now.getHours(); //小时 
        //判断星期几 
        var weeks = ["日","一","二","三","四","五","六"]; 
        // var getWeek = "星期" + weeks[week]; 
        var sc; 
        //判断是AM or PM 
        if(hour >= 0 && hour < 5){ 
        sc = '凌晨'; 
        } 
        else if(hour > 5 && hour <= 7){ 
        sc = '早上'; 
        } 
        else if(hour > 7 && hour <= 11){ 
        sc = '上午'; 
        } 
        else if(hour > 11 && hour <= 13){ 
        sc = '中午'; 
        } 
        else if(hour> 13 && hour <= 18){ 
        sc = '下午'; 
        } 
        else if(hour > 18 && hour <= 23){ 
        sc = '晚上'; 
        } 
        // document.getElementById('time').innerHTML ="当前时间：" + date+" " + getWeek +" "+"   "+sc+"  "+time;
        // console.log('日期', date)
        console.log('时间', time)
        this.date = date
        this.time = time
        // setTimeout('showTime()',1000); 
      },
      getRegularList () {
        this.$api.regularList({}, ({'showLoading': true})).then(res => {
          let list = []
          // res.data.push({is_default: 1, regular_name: '哈哈'})
          res.data.forEach((item => {
            if (item.is_default == 1) {
              list.unshift(item)
            } else {
              list.push(item)
            }
          }))
          this.userList = list
        })
      },
      showModal () {
        // console.log(1)
        this.modalStyle = 'felx'
      },
      toSuccess() {
        if (this.interrogationKey != '1' && this.interrogationKey != '2') {
          // this.modalShow = true
        }
        let list1 = ''
        let list2 = ''
        let list3 = ''
        let list4 = ''
        let list5 = ''
        let list6 = ''
        let list7 = ''
        let list8 = ''
        let list9 = ''
        this.arraySum.list1.forEach((item,index)=>{
          // console.log(item)
          if (item.class == 'active') {
            list1 += (item.name+',')
            // list1 += (item.name)
            // this.step.anamnesis.jb += (item.name)
            // if ((index+1) == this.arraySum.list1.length) {
              // list1 += (item.name)
            // } else {
            //   list1 += (item.name+',')
            // }
          }
        })
        this.step.anamnesis.jb = list1
        this.step.anamnesis.jb = this.step.anamnesis.jb.substring(0,this.step.anamnesis.jb.length-1);
        console.log(this.step.anamnesis.jb)
        this.arraySum.list2.forEach((item,index)=>{
          if (item.class == 'active') {
            list2 += (item.name+',')
            //   if ((index+1) == this.arraySum.list2.length) {
            //   this.step.anamnesis.crb += (item.name)
            // } else {
            //   this.step.anamnesis.crb += (item.name+',')
            // }
          }
          
        })
        this.step.anamnesis.crb = list2
        this.step.anamnesis.crb = this.step.anamnesis.crb.substring(0,this.step.anamnesis.crb.length-1);
        this.arraySum.list3.forEach((item,index)=>{
          if (item.class == 'active') {
            list3 += (item.name+',')
            //   if ((index+1) == this.arraySum.list3.length) {
            //   this.step.anamnesis.sss += (item.name)
            // } else {
            //   this.step.anamnesis.sss += (item.name+',')
            // }
          }
          
        })
        this.step.anamnesis.sss = list3
        this.step.anamnesis.sss = this.step.anamnesis.sss.substring(0,this.step.anamnesis.sss.length-1);
        this.arraySum.list4.forEach((item,index)=>{
          if (item.class == 'active') {
            list4 += (item.name+',')
            //   if ((index+1) == this.arraySum.list4.length) {
            //   this.step.allergy_history.ywgm += (item.name)
            // } else {
            //   this.step.allergy_history.ywgm += (item.name+',')
            // }
          }
          
        })
        this.step.allergy_history.ywgm = list4
        this.step.allergy_history.ywgm = this.step.allergy_history.ywgm.substring(0,this.step.allergy_history.ywgm.length-1);
        this.arraySum.list5.forEach((item,index)=>{
          if (item.class == 'active') {
            list5 += (item.name+',')
            //   if ((index+1) == this.arraySum.list5.length) {
            //   this.step.allergy_history.swgm += (item.name)
            // } else {
            //   this.step.allergy_history.swgm += (item.name+',')
            // }
          }
          
        })
        this.step.allergy_history.swgm = list5
        this.step.allergy_history.swgm = this.step.allergy_history.swgm.substring(0,this.step.allergy_history.swgm.length-1);
        this.arraySum.list6.forEach((item,index)=>{
          if (item.class == 'active') {
              // if ((index+1) == this.arraySum.list6.length) {
              this.step.obsterical_history.hyzk = (item.name)
            // } else {
              // this.step.obsterical_history.hyzk += (item.name+',')
            // }
          }
          
        })
        // this.step.obsterical_history.hyzk = this.step.obsterical_history.hyzk.substring(0,this.step.obsterical_history.hyzk.length-1);
        this.arraySum.list7.forEach((item,index)=>{
          if (item.class == 'active') {
              // if ((index+1) == this.arraySum.list7.length) {
              this.step.obsterical_history.syzt = (item.name)
            // } else {
              // this.step.obsterical_history.syzt += (item.name+',')
            // }
          }
          
        })
        // this.step.obsterical_history.syzt = this.step.obsterical_history.syzt.substring(0,this.step.obsterical_history.syzt.length-1);
        this.arraySum.list8.forEach((item,index)=>{
          if (item.class == 'active') {
            list8 += (item.name+',')
            //   if ((index+1) == this.arraySum.list8.length) {
            //   this.step.family_history.jzs_jsz += (item.name)
            // } else {
            //   this.step.family_history.jzs_jsz += (item.name+',')
            // }
          }
          
        })
        this.step.family_history.jzs_jsz = list8
        this.step.family_history.jzs_jsz = this.step.family_history.jzs_jsz.substring(0,this.step.family_history.jzs_jsz.length-1);
        this.arraySum.list9.forEach((item,index)=>{
          if (item.class == 'active') {
            list9 += (item.name+',')
            //   if ((index+1) == this.arraySum.list9.length) {
            //   this.step.personal_habits.grxg_grxg += (item.name)
            // } else {
            //   this.step.personal_habits.grxg_grxg += (item.name+',')
            // }
          }
          
        })
        this.step.personal_habits.grxg_grxg = list9
        this.step.personal_habits.grxg_grxg = this.step.personal_habits.grxg_grxg.substring(0,this.step.personal_habits.grxg_grxg.length-1);
        this.step.doctor_id = this.doctorInfo.doctor_id
        this.step.apt_diagnosis_time = this.date
        // if (this.userId) {
          this.step.regular_id = this.userId
        // }
         this.step.doctor_id = this.doctorInfo.doctor_id || this.doctorInfo.doctor_id
          if (this.interrogationKey == '1' || this.interrogationKey == '2') {
            this.step.apt_diagnosis_time = this.date
            delete this.step.arrange_info_id
          } else {
            delete this.step.apt_diagnosis_time
            this.step.arrange_info_id = this.doctorInfo.arrange_info_id
            delete this.step.doctor_id
          }
        this.upImg.forEach(item=> {
          this.step.upload_image.push(item[0].file_key)
        })
        this.step.type = this.interrogationKey == 1 ?  '3' : '4'
        if (!this.step.regular_id ||  this.step.regular_id == '') {
          // wx.showModal({
          //     title: '错误提示',
          //     content: '请选择就诊人后再预约',
          //     showCancel: false,
          //     success: function (res) {
                
          //   }
          // })
          this.$utils.showToast('text', '请选择就诊人后再预约')
          return;
        }
        console.log(this.step.regular_id)
        if (!this.step.current_medical_history ||  this.step.current_medical_history == '') {
          // wx.showModal({
          //     title: '错误提示',
          //     content: '请填写病情描述后再预约',
          //     showCancel: false,
          //     success: function (res) {
                
          //   }
          // })
          this.$utils.showToast('text', '请填写病情描述后再预约')
          return;
        }
        if (!this.step.anamnesis.jb ||  this.step.anamnesis.jb == '') {
          // wx.showModal({
          //     title: '错误提示',
          //     content: '请填写疾病史后再预约',
          //     showCancel: false,
          //     success: function (res) {
                
          //   }
          // })
          this.$utils.showToast('text', '请填写疾病史后再预约')
          return;
        }
        if (!this.step.anamnesis.crb ||  this.step.anamnesis.crb == '') {
          // wx.showModal({
          //     title: '错误提示',
          //     content: '请填写传染病史后再预约',
          //     showCancel: false,
          //     success: function (res) {
                
          //   }
          // })
          this.$utils.showToast('text', '请填写传染病史后再预约')
          return;
        }
        if (!this.step.anamnesis.sss ||  this.step.anamnesis.sss == '') {
          // wx.showModal({
          //     title: '错误提示',
          //     content: '请填写手术史后再预约',
          //     showCancel: false,
          //     success: function (res) {
                
          //   }
          // })
          this.$utils.showToast('text', '请填写手术史后再预约')
          return;
        }
        if (!this.step.allergy_history.ywgm ||  this.step.allergy_history.ywgm == '') {
          // wx.showModal({
          //     title: '错误提示',
          //     content: '请填写药物过敏后再预约',
          //     showCancel: false,
          //     success: function (res) {
                
          //   }
          // })
          this.$utils.showToast('text', '请填写药物过敏后再预约')
          return;
        }
        // console.log(this.step.allergy_history.ywgm)
        if (!this.step.allergy_history.swgm ||  this.step.allergy_history.swgm == '') {
          // wx.showModal({
          //     title: '错误提示',
          //     content: '请填写食物过敏后再预约',
          //     showCancel: false,
          //     success: function (res) {
                
          //   }
          // })
          this.$utils.showToast('text', '请填写食物过敏后再预约')
          return;
        }
        // console.log(this.step.allergy_history.swgm)
        // if (!this.step.obsterical_history.hyzk ||  this.step.obsterical_history.hyzk == '') {
        //   // wx.showModal({
        //   //     title: '错误提示',
        //   //     content: '请填写药物过敏后再预约',
        //   //     showCancel: false,
        //   //     success: function (res) {
                
        //   //   }
        //   // })
        //   this.$utils.showToast('text', '请填写婚姻状况后再预约')
        //   return;
        // }
        // if (!this.step.obsterical_history.syzt ||  this.step.obsterical_history.syzt == '') {
        //   // wx.showModal({
        //   //     title: '错误提示',
        //   //     content: '请填写药物过敏后再预约',
        //   //     showCancel: false,
        //   //     success: function (res) {
                
        //   //   }
        //   // })
        //   this.$utils.showToast('text', '请填写生育状态后再预约')
        //   return;
        // }
        if (!this.step.family_history.jzs_jsz ||  this.step.family_history.jzs_jsz == '') {
          // wx.showModal({
          //     title: '错误提示',
          //     content: '请填写家族史后再预约',
          //     showCancel: false,
          //     success: function (res) {
                
          //   }
          // })
          this.$utils.showToast('text', '请填写家族史后再预约')
          return;
        }
        
        
        console.log(this.step)
         if (this.interrogationKey == '1' || this.interrogationKey == '2') {
           this.$api.save(this.step, ({'showLoading': true})).then(res => {
            // console.log('预约成功返回数据',res)
            let data = JSON.stringify(res.data)
            this.$router.replace(`/pages/subPage/register/registerSuccess/main?data=${data}`)
          }).catch(err => {
            console.log(err)
            // $utils.showToast('text', '网络连接异常,请稍后再试')
            // wx.showModal({
            //     title: '错误提示',
            //     content: err,
            //     showCancel: false,
            //     success: function (res) {
                  
            //   }
            // })
          })
        } else {
          console.log(this.step)
          this.$api.saveDeptDoctor(this.step, ({'showLoading': false})).then(res => {
            // console.log('预约成功返回数据',res)
            let data = JSON.stringify(res.data)
            console.log(res.data)
            this.$router.replace(`/pages/subPage/register/registerSuccess/main?data=${data}`)
          }).catch(err => {
            // console.log(err)
            // wx.showModal({
            //     title: '错误提示',
            //     content: err,
            //     showCancel: false,
            //     success: function (res) {
                  
            //   }
            // })
          })
          }
       
        // this.$router.push(`/pages/subPage/register/registerSuccess/main`)
      }
    },
    onUnload () {
      let that = this
      that.step.regular_id = null
      that.userId = null
      that.modalStyle = 'none'
    },
    onShow () {
      // this.getWechatList()
      // console.log(api.host)
      // let host = ''
      // if (process.env.NODE_ENV === 'production') {
      //     // npm run build: ****
      //     host = process.env.http
      //   } else {
      //     // host = 'http://dev-ihosp.medicalmobile.cn' // 开发环境
      //     host = 'http://dev-ihosp.medicalmobile.cn' // 测试环境
      //     // host = 'https://release-ihosp.medicalmobile.cn' // 预发布环境
      //     // host = 'https://wdrm.hiseemedical.com' // 正式环境
      //   }
      //   this.host = host
        // console.log(host)
    //     this.files = []
    //     this.upImg = []
    //   this.userDetails = {
    //       regular_name: '',
    //       regular_certid: '',
    //       regular_phone: ''
    //     }
    //  this.arraySum = {
    //       // 疾病史
    //       list1:[
    //         {name:'无', key:'0', class:''},
    //         {name:'哮喘', key:'1', class:''},
    //         {name:'高血脂症', key:'2', class:''},
    //         {name:'高血压', key:'3', class:''},
    //         {name:'高尿酸血症', key:'4', class:''},
    //         {name:'癫痫', key:'5', class:''},
    //         {name:'心脏病', key:'6', class:''},
    //         {name:'糖尿病', key:'7', class:''},
    //         {name:'脑卒中', key:'8', class:''},
    //         {name:'胃炎', key:'9', class:''},
    //         {name:'肝炎', key:'10', class:''}
    //       ],
    //       // 传染病史
    //       list2:[
    //         {name:'无', key:'0', class:''},
    //         {name:'肺结核', key:'1', class:''},
    //         {name:'病毒性肝炎', key:'2', class:''},
    //         {name:'血吸虫病', key:'3', class:''},
    //         {name:'淋病', key:'4', class:''}
    //       ],
    //       // 手术史
    //       list3:[
    //         {name:'无', key:'0', class:''},
    //         {name:'颅部手术', key:'1', class:''},
    //         {name:'颈部手术', key:'2', class:''},
    //         {name:'胸部手术', key:'3', class:''},
    //         {name:'腹部手术', key:'4', class:''},
    //         {name:'四肢手术', key:'5', class:''},
    //         {name:'骨折', key:'6', class:''},
    //         {name:'烧伤', key:'7', class:''},
    //         {name:'烫伤', key:'8', class:''},
    //         {name:'头部外伤', key:'9', class:''},
    //         {name:'肌腱外伤', key:'10', class:''}
    //       ],
    //       // 药物过敏
    //       list4:[
    //         {name:'无', key:'0', class:''},
    //         {name:'青霉素', key:'1', class:''},
    //         {name:'头孢类抗生素', key:'2', class:''},
    //         {name:'破伤风抗生素', key:'3', class:''},
    //         {name:'普鲁卡因', key:'4', class:''},
    //         {name:'地卡因', key:'5', class:''},
    //         {name:'磺胺类药物', key:'6', class:''},
    //         {name:'维生素B1', key:'7', class:''},
    //         {name:'泛影葡胺', key:'8', class:''},
    //         {name:'阿司匹林', key:'9', class:''}
    //       ],
    //       // 食物过敏
    //       list5:[
    //         {name:'无', key:'0', class:''},
    //         {name:'芒果', key:'1', class:''},
    //         {name:'牛奶', key:'2', class:''},
    //         {name:'海鲜', key:'3', class:''},
    //         {name:'笋', key:'4', class:''},
    //         {name:'香菇', key:'5', class:''},
    //         {name:'黄瓜', key:'6', class:''},
    //         {name:'油漆', key:'7', class:''},
    //         {name:'花粉', key:'8', class:''},
    //         {name:'皮毛', key:'9', class:''}
    //       ],
    //       // 婚姻史
    //       list6:[
    //         {name:'已婚', key:'1', class:''},
    //         {name:'未婚', key:'2', class:''}
    //       ],
    //       // 生育状态
    //       list7:[
    //         {name:'未生育', key:'1', class:''},
    //         {name:'备孕期', key:'2', class:''},
    //         {name:'怀孕期', key:'3', class:''},
    //         {name:'已生育', key:'4', class:''}
    //       ],
    //       // 家族史
    //       list8:[
    //         {name:'无', key:'0', class:''},
    //         {name:'高血压', key:'1', class:''},
    //         {name:'糖尿病', key:'2', class:''},
    //         {name:'心脏病', key:'3', class:''},
    //         {name:'脑梗', key:'4', class:''},
    //         {name:'脑出血', key:'5', class:''},
    //         {name:'癌症', key:'6', class:''},
    //         {name:'过敏性疾病', key:'7', class:''},
    //         {name:'哮喘', key:'8', class:''},
    //         {name:'癫痫病', key:'9', class:''},
    //         {name:'白癜风', key:'10', class:''}
    //       ],
    //       // 个人习惯
    //       list9:[
    //         {name:'无', key:'0', class:''},
    //         {name:'吸烟', key:'1', class:''},
    //         {name:'饮酒', key:'2', class:''},
    //         {name:'熬夜', key:'3', class:''},
    //         {name:'低头', key:'4', class:''},
    //         {name:'久坐', key:'5', class:''},
    //         {name:'久站', key:'6', class:''},
    //         {name:'跷二郎腿', key:'7', class:''},
    //         {name:'强忍大小便', key:'8', class:''},
    //         {name:'饭后卧床', key:'9', class:''},
    //         {name:'如厕看书报', key:'10', class:''},
    //         {name:'不喜喝水', key:'11', class:''}
    //       ]
    //     }
    //  this.step = {
    //        allergy_history: {
    //           qt: "",
    //           swgm: "",
    //           ywgm: ""
    //         },
    //         anamnesis: {
    //           crb: "",
    //           jb: "",
    //           qt: "",
    //           sss: ""
    //         },
    //         apt_diagnosis_time: "",
    //         current_medical_history: "",
    //         doctor_id: "",
    //         family_history: {
    //           jzs_jsz: "",
    //           qt: ""
    //         },
    //         obsterical_history: {
    //           hyzk: "",
    //           syzt: ""
    //         },
    //         personal_habits: {
    //           grxg_grxg: "",
    //           qt: ""
    //         },
    //         regular_id: "",
    //         type: "3",
    //         upload_image: []
    //       }
      this.modalStyle = 'none'
     this.doctorInfo = JSON.parse(this.$route.query.doctorInfo)
     if (!this.doctorInfo.image_text_price) {
       this.doctorInfo.image_text_price = 0
     }
     if (!this.doctorInfo.video_price) {
       this.doctorInfo.video_price = 0
     }
    //  console.log(this.doctorInfo)
     this.interrogationKey = this.$route.query.key
     this.getRegularList()
    //  console.log('上个页面带过来的医生信息', this.doctorInfo)
     this.getDateTime()
    },
    watch: {
      sessionsList: function(oldValue, newValue) {
        // this.dealData()
      }
    }
  }
</script>

<style scoped lang='less'>
  .slash{
    color:#CCCCCC;
  }
  .redClolr{
    color:#FF5453;
    font-size: 20rpx;
  }
  .subPage {
    display: flex;
    flex-direction: column;
  }
  .navBox{
    padding: 10rpx 60rpx;
    width:630rpx;
    height:92rpx;
    background:rgba(74,100,234,1);
    .navTop{
      margin-left:52rpx;
      span{
        display: inline-block;
      }
      .circular{
        width: 19rpx;
        height: 19rpx;
        border-radius: 50rpx;
        background: #FFFFFF;
        border: 1rpx solid #FFFFFF;
      }
      .lineClass{
        width: 150rpx;
        border-top: 1rpx solid #FFFFFF;
        height: 13rpx;
        line-height: 19rpx;
      }
      .opacityClass{
        opacity:0.2;
      }
    }
    .navTop>span:nth-child(5){
      background: none;
    }
    .navTop>span:nth-child(7){
      background: none;
    }
    .navBom{
      span{
        display: inline-block;
        font-size:30rpx;
        font-weight:400;
        color:rgba(255,255,255,1);
        margin-right: 50rpx;
      }
    }
    .navBom>span:nth-child(4){
       margin-right: 0rpx;
    }
  }
  .centBox{
    // height: 1074rpx;
    overflow-x: hidden;
    overflow-y: auto;
    background: #F9F9F9;
    .userMsg{
      // width:690rpx;
      height:160rpx;
      // background:rgba(245,245,245,1);
      padding:34rpx 50rpx 37rpx 50rpx;
      background:#FFFFFF;
      margin-bottom:16rpx;
      .topBox{
        width: 100%;
        display: flex;
        justify-content:space-between;
        .topLeft{
          font-size:50rpx;
          font-family:PingFangSC-Medium,PingFang SC;
          font-weight:500;
          color:rgba(51,51,51,1);
        }
        .topRight{
          font-size:30rpx;
          font-family:PingFangSC-Regular,PingFang SC;
          font-weight:400;
          color:rgba(51,51,51,1);
        }
      }
      .divTop{
        height:50rpx;
        background:rgba(235,245,255,1);
        font-size:30rpx;
        font-weight:600;
        color:rgba(37,143,248,1);
        line-height: 50rpx;
        margin-bottom:20rpx;
        width: 140rpx;
        text-align: center;
      }
      span{
        display: inline-block;
      }
      .divCenter{
        margin-bottom:7rpx;
      }
      .divCenter>span:nth-child(1){
          font-size:36rpx;
          font-weight:600;
          color:rgba(74,113,232,1);
          margin-right: 20rpx;
        }
      .divCenter>span:nth-child(2){
          font-size:30rpx;
          font-weight:400;
          color:rgba(51,51,51,1);
        }
      .divBom{
        display: flex;
        justify-content:space-between;
        span{
          line-height: 52rpx;
        }
        div{
          display: block;
        }
      }
      .divBom>span:nth-child(1){
          font-size:30rpx;
          font-weight:400;
          color:rgba(51,51,51,1);
        }
        .divBom>span:nth-child(2){
          font-size:40rpx;
          font-weight:600;
          color:rgba(255,84,83,1);
        }
      
    }
    .detailsBox>div{
          border-bottom: 1rpx solid #E9E9E9;
        }
      .detailsBox{
        background:#FFFFFF;
        .choiceBox{
          height: 90rpx;
          font-size:36rpx;
          font-weight:600;
          color:rgba(51,51,51,1);
          line-height: 90rpx;
          padding-left:40rpx;
          position: relative;
          .iconBox{
            // position: relative;
            span{
              position:absolute;
              right: 85rpx;
              top: 3rpx;
              color: #258ff8;
              font-size: 30rpx;
              font-weight: 300;
            }
            img{
              width: 17rpx;
              height: 30rpx;
              position:absolute;
              right: 30rpx;
              top: 34rpx;
            }
          }
          
        }
      }
      .msgBox{
        height: 150rpx;
        padding: 30rpx 40rpx 30rpx 40rpx;
        div{
          margin-bottom:10rpx;
        }
        span{
          font-size:30rpx;
          font-weight:400;
          color:rgba(51,51,51,1);
        }
        .identityClass{
          display: inline-block;
          width:68rpx;
          height:41rpx;
          background:rgba(16,193,91,1);
          font-size:24rpx;
          font-weight:400;
          // color:rgba(255,255,255,1);
          line-height: 41rpx;
          text-align: center;
          margin-left: 20rpx;
          color: #FFFFFF;

        }
        .labelClass{
          display:inline-block;
          font-size:30rpx;
          font-weight:300;
          color:#666666;
          width:150rpx;
        }
      }
      .msgBox>div:nth-child(3){
        margin-bottom:0rpx;
      }
      .describeBox{
        position: relative;
        border-bottom: 0rpx solid #E9E9E9!important;
        .iptBox{
          display: block;
        }
        .ipt{
          padding:30rpx;
          height: 215rpx!important;
          width: 670rpx!important;
          display: block;
          color:#999999;
          line-height: 32rpx;
          font-size: 28rpx;
        }
        .phClass{
          color:#999999;
        }
        .ipt3{
          padding:30rpx;
          height: 215rpx!important;
          width: 670rpx!important;
          display: block;
          color:#999999;
          line-height: 32rpx;
          font-size: 28rpx;
        }
        .record{
          position: absolute;
          font-size:30rpx;
          font-weight:300;
          color:rgba(204,204,204,1);
          bottom:50%;
          right: 40rpx;
        }
      }
      .uploadBox{
        width: 80%;
        padding-left:30rpx;
        max-height: 250rpx;
        .upload{
          display:inline-block;
          width:100rpx;
          height:100rpx;
          background:rgba(247,248,250,1);
          border-radius:4rpx;
          // border: 1rpx solid rgba(204,204,204,1);
          // margin:30rpx;
          margin-right: 20rpx;
          overflow: hidden;
          img{
            width:100%;
            height:100%;
          }
        }
        .uploadImgBox{
          position: relative;
          .closeClass{
            width:30rpx;
            height: 30rpx;
            position: absolute;
            top:0;
            right: 0;
            z-index:99;
          }
        }
        .uploadRight{
          // margin-left: 100rpx;
          position: relative;
          left: 120rpx;
          bottom: 106rpx;
          width: 80%;
        }
        .selectBox{
          overflow:hidden;
          img{
            width: 100%;
            height: 100%;
          }
        }
      }
      .caseBox{
        background: #FFFFFF;
        .caseTit{
          padding-left: 30rpx;
          height: 60rpx;
          background: #ebf5ff;
          font-size: 36rpx;
          font-weight: 600;
          color: #4a71e8;
          line-height: 60rpx;
        }
        .diseaseTit{
          padding: 20rpx 30rpx;
          font-size:30rpx;
          font-weight:400;
          color:rgba(51,51,51,1);
        }
        .diseaseBox{
          // display: flex;
          // justify-content:space-around;
          border-bottom: 1rpx solid rgba(204,204,204,1);
          padding-left:30rpx;
          li{
            width:210rpx;
            height:70rpx;
            background:rgba(245,245,245,1);
            border: 1rpx solid rgba(245,245,245,1);
            border-radius:4rpx;
            display: inline-block;
            margin-right: 25rpx;
            margin-bottom:30rpx;
            text-align: center;
            line-height: 70rpx;
            font-size:30rpx;
            font-weight:300;
            color:rgba(51,51,51,1);
          }
          .active{
            border: 1rpx solid #4A71E8;
            background:rgba(235,245,255,1);
            color:#4A71E8;
          }
        }
        .otherBox{
          padding-left:30rpx;
          span{
            display: inline-block;
            font-size:36rpx;
            font-weight:400;
            color:rgba(51,51,51,1);
            padding: 20rpx 0;
          }
        }
        .otherBox>span:nth-child(1){
          margin-right: 30rpx;
        }
        .otherBox>span:nth-child(2){
         vertical-align: bottom;
        }
        .ipt2{
          font-size:36rpx;
            font-weight:400;
            color:rgba(51,51,51,1);
        }
        
      }
      .btnBox{
        margin: 30rpx;
          font-size:36rpx;
          font-weight:400;
          color:rgba(255,255,255,1);
          text-align: center;
          height: 80rpx;
          line-height: 80rpx;
          background: #4253E1;
          border-radius: 10rpx;
        }
  }
  .modalShowClass{
    position: absolute;
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    background: rgba(0, 0, 0, 0.6);
    justify-content: flex-end;
    align-items: center;
    flex-direction: column;
    width: 100%;
    height: 100%;
    z-index: 9;
    .modalBox{
      width: 100%;
      // height:663rpx;
      z-index:99;
      background: #FFFFFF;
      // border-radius:12px;
      // border-bottom-right-radius: 0;
      // border-bottom-left-radius: 0;
      .closeBox{
        width: 60rpx;
        height: 60rpx;
        position: absolute;
        right: 0rpx;
        // right: -30rpx;
        // top: -30rpx;
        img{
          width: 100%;
          height: 100%;
          z-index:99;
        }
      }
      .modalTit{
        height:90rpx;
        line-height: 90rpx;
        width: 100%;
        text-align: center;
        font-size:34rpx;
        // font-family:PingFangSC-Medium,PingFang SC;
        font-weight:500;
        color:rgba(51,51,51,1);
        border-bottom: 1rpx solid #E9E9E9;
      }
      .modalCenter{
        // padding: 67rpx 30rpx 33rpx 37rpx;
        display: flex;
        flex-direction:column;
        margin-bottom: 166rpx;
        .paymentBox{
          width:686rpx;
          height:50rpx;
          padding: 0 32rpx;
          padding-top: 22rpx;
          padding-bottom: 28rpx;
          border-top: 1rpx solid #E9E9E9;
          border-bottom: 1rpx solid #E9E9E9;
          display: flex;
          justify-content: space-between;
          .paymentLeft{
            width:50rpx;
            height:50rpx;
            border: 1rpx solid red; 
          }
          .paymentCenter{
            height: 50rpx;
            line-height: 50rpx;
            width: 576rpx;
            margin-left: 21rpx;
            margin-right: 21rpx;
            text-align: left;
            .left{
              font-size: 32rpx;
              font-weight:500;
              color:#333333;
            }
            .right{
              font-size: 28rpx;
              font-weight:400;
              color:#999999;
            }
          }
          .paymentRight{
            width:50rpx;
            height:50rpx;
            border: 1rpx solid red; 
          }
        }
      }
      .modalFooter{
        // width:544rpx;
        height:92rpx;
        background:rgba(74,100,234,1);
        border-radius:38rpx;
        font-size:32rpx;
        font-weight:600;
        color:rgba(255,255,255,1);
        margin: 0 37rpx 63rpx 37rpx;
        line-height: 92rpx;
        text-align: center;
      }
      .btnDis{
        background: #c5c8ce;
      }
    }
  }
    .modalClass{
    position: absolute;
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: 100%;
    height: 100%;
    z-index: 9;
    // background:rgba(0,0,0,1);
    // opacity:0.6;
    .modalBox{
      width: 617rpx;
      // height:663rpx;
      z-index:99;
      background: #FFFFFF;
      border-radius:12px;
      position: relative;
      .modalTit{
        width: 100%;
        img{
          width: 100%;
          height: 220rpx;
        }
      }
      .closeBox{
        width: 60rpx;
        height: 60rpx;
        position: absolute;
        right: -30rpx;
        top: -30rpx;
        img{
          width: 100%;
          height: 100%;
          z-index:99;
        }
      }
      .modalCenter{
        padding: 67rpx 30rpx 33rpx 37rpx;
        display: flex;
        flex-direction:column;
        .picClass{
          height: 131rpx;
          line-height: 131rpx;
          text-align: center;
          border-top: 1rpx solid #E9E9E9;
          border-bottom: 1rpx solid #E9E9E9;
          div{
            font-size:50rpx;
            font-weight:normal;
            color:rgba(34,75,198,1);
          }
        }
        .dataBox{
          margin-bottom: 40rpx;
          span{
            display: inline-block;
            font-size:28rpx;
            font-weight:400;
            color:rgba(102,102,102,1);
            vertical-align: middle;
          }
          .itemPie{
            width:12rpx;
            height:12rpx;
            background:rgba(74,100,234,1);
            border-radius: 50%;
            margin-right: 15rpx;
            // vertical-align: middle;
            margin-bottom: 5rpx;
          }
          .itemSpan{
            width:95%;

          }
        }
      }
      .modalFooter{
        div{
          width:309rpx;
          height:90rpx;
          font-size:36rpx;
          font-weight:400;
          display: inline-block;
          text-align:center;
          line-height:90rpx;
        }
       .btnLeft{
         background:rgba(247,248,250,1);
         border-radius:0rpx 0rpx 0rpx 24rpx;
         color:#333333;
       }
       .btnRight{
         background:rgba(74,100,234,1);
         border-radius:0rpx 0rpx 24rpx 0rpx;
         color:#ffffff;
       }
      }
      .btnDis{
        background: #c5c8ce;
      }
    }
  }
  
</style>
